package com.an.blog.admin.domain.bo;

import com.an.common.core.domain.BaseEntity;
import com.an.common.core.validate.AddGroup;
import com.an.common.core.validate.EditGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 博客友链业务对象 blog_friend_link
 *
 * @author Ann
 * @date 2023-10-17
 */

@Data
@EqualsAndHashCode(callSuper = true)
public class BlogFriendLinkBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 友链标题
     */
    @NotBlank(message = "博客标题不能为空", groups = { AddGroup.class, EditGroup.class })
    private String blogTitle;

    /**
     * 博客地址
     */
    @Pattern(regexp = "(http|https)://[\\w-]+(\\.[\\w-]+)+([\\w-.,@?^=%&:/~+#]*[\\w-@?^=%&/~+#])?",
        message = "请输入规范的链接地址", groups = { AddGroup.class, EditGroup.class })
    @NotBlank(message = "博客地址不能为空", groups = { AddGroup.class, EditGroup.class })
    private String blogAddress;

    /**
     * 博客logo图片
     */
    @NotNull(message = "博客logo不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long blogLogoImage;

    /**
     * 博客desc
     */
    @NotBlank(message = "博客简介不能为空", groups = { AddGroup.class, EditGroup.class })
    private String blogDesc;

    /**
     * 状态（0正常 1禁用）
     */
    private String status;

}
